home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / fortune4.arc / FORTUNE.DOC < prev    next >
Text File  |  1987-04-23  |  15KB  |  319 lines

  1. -------------------------------------------------------------------
  2.                       FORTUNE Version 4.10
  3. -------------------------------------------------------------------
  4.  
  5. Copyright (c) 1986,1987 by Christopher D. Orr.  All rights reserved.
  6.  
  7.  
  8.  
  9. FORTUNE VERSION 4.10 is currently distributed as User Supported
  10. Software.  With a few restrictions, this allows the
  11. program, although copyrighted, to be freely copied and
  12. distributed.
  13.  
  14. This product must be copied and distributed as a complete
  15. package.  This includes the FORTUNE 4.10 program (FORTUNE.COM),
  16. this documentation file (FORTUNE.DOC), (BYE.LNS), (FORTCONV.COM),
  17. and (FORTCONV.DOC).  FORTUNE 4.10 is copyrighted and may not be
  18. distributed if altered or modified in any way (with the exception
  19. of the BYE.LNS file - you may add fortunes, but please don't delete
  20. any.)  Finally, no fee is to be charged for copying or distributing
  21. the programs without my written permission.
  22.  
  23. In short, FORTUNE 4.10 may be copied and distributed to
  24. anyone who wishes it as long as it is a complete unmodified
  25. package including the program and documentation and no fee
  26. is charged.  
  27.  
  28.  
  29.                               Christopher D. Orr
  30.                               1907 Willow Park Rd. 
  31.                               Bethlehem, PA  18017
  32.  
  33.  
  34.  
  35. REQUIRED CONFIGURATION
  36.  
  37.         * Any MS-DOS computer
  38.          * DOS 2.0 or above
  39.  
  40.  
  41.  
  42. COMMAND LINE SYNTAX
  43.  
  44.     [C:\] FORTUNE {-acdfnprs{l}##} {your_name}
  45.  
  46.  
  47.  
  48. INSTALLING FORTUNE 4.10
  49. -----------------------
  50.  
  51. Floppy Disk Users:
  52.    Place FORTUNE on your DOS disk for use.  Whenever you want to use FORTUNE,
  53. you will use it from your DOS disk.  Additionally, place the following line in
  54. your AUTOEXEC.BAT file:
  55.                 SET NAME=your_name
  56. where your_name if the name you would like to addressed as.  The maximum length
  57. your name can be is 50 characters.
  58.  
  59.  
  60. Hard Disk Users:
  61.    FORTUNE and its data files can be stored in any directory.  If the directory
  62. name is included in the path definition, FORTUNE will find its data files.
  63. Addionally, place the following line in your AUTOEXEC.BAT file:
  64.                 SET NAME=your_name
  65. where your_name if the name you would like to addressed as.  The maximum length
  66. your name can be is 50 characters.
  67.    You may also want to use the MORE_BYE.LNS file supplied with FORTUNE.  To
  68. do this you will need a line saying:
  69.                 SET LINES=c:\fortune\bye.lns;c:\fortune\more_bye.lns
  70. This will tell fortune to get its fortunes from both files.
  71.  
  72.  
  73. What Data File should I Use?
  74. ----------------------------
  75.    By using the enviroment variable LINES, you can tell fortune where to
  76. find the BYE.LNS file.  If you want to use a different name (other than
  77. BYE.LNS), you can specify that here too.  For example, if you keep the BYE.LNS
  78. file in your UTILS directory, the command would be
  79.       SET LINES=C:\UTILS\BYE.LNS
  80.    If you omit the directory the file is in, Fortune will search the path to
  81. try and find the file.
  82.  
  83.  
  84. Using FORTUNE is AUTOEXEC.BAT files:
  85. ------------------------------------
  86.      Many of you may wish to use FORTUNE as the last line of your autoexec
  87. file.  The key here is to put FORTUNE in after you have set the time and date.
  88. The reason for doing this is because fortune uses the time and date to generate
  89. its random number.
  90.  
  91.  
  92.  
  93. SWITCHES
  94.  
  95.   The command line is of the form  FORTUNE {-acdfnprs##} {your_name}.  The 
  96. switches recognized by FORTUNE are discussed below:
  97.  
  98.    a - Ansi Graphics
  99.          This switch tells fortune to use the ANSI graphics device driver
  100.        instead of interupt calls to change the screen colors, clear the screen,
  101.        etc.
  102.  
  103.    b - BBS Style Output.  Greeting is "QUOTE OF THE DAY" followed by a quote.
  104.          This makes Ansi default on, Clear Screen default Off, and Tell default
  105.          to off.  Redirect output to capture to your news file.
  106.  
  107.    c - Clean the Sreen before displaying fortune (default).
  108.  
  109.    d - Change Separator Character.
  110.           This switch will allow you to change the default separator char
  111.        in the BYE.LNS file.  The default character is the Null char (^@),
  112.        Ascii code 0.  You can use the switch in 2 ways.  
  113.                /d{char}   or   /d{ascii code}
  114.        So, to use the Null Character, you would type /d0 or /d^@.
  115.        (Obviously, the ^@ can't be typed in DOS, so you would have to use the
  116.        ascii code in this case).  See the program FORTCONV to convert FORTUNE's
  117.        asscociated BYE.LNS file if you would like to use this option.
  118.           If you have a file separated by a blank line, use the switch /d13.
  119.        This will tell fortune to correctly read that file.
  120.           This switch can ONLY be set through the environment variable
  121.        FORTUNE (see below).  There is a safeguard built into the switch so if
  122.        you do specify a separator character that doesn't appear, FORTUNE will
  123.        eventually abort.
  124.  
  125.    f - Use a different BYE.LNS file
  126.           For those of you who would prefer to use a filename other than
  127.        BYE.LNS, you can do so with this command line switch.  This can also
  128.        be accomplished using the enviroment variable LINES (e.g. Use the
  129.        command SET LINES={filespec}).  You can specify Fortune to use more than
  130.        one Bye.Lns file by separating each one with a semi-colon.
  131.        (NOTE: if the -d parameter is used, all files must be on the same type!)
  132.        If you do specify more that one BYE.LNS file, they should all be of
  133.        approx. equal size.  To add code to check the # of fortunes in each
  134.        file and choose the file to use based on that would take too long when
  135.        giving a fortune.
  136.  
  137.    h - Turn off Greeting switch to prevent greeting message.  This switch
  138.         toggles so first occurance turns it off, the next on, etc.
  139.  
  140.    i - Use an index file.  See below.
  141.  
  142.    n - Don't clear the screen                                       
  143.          This switch will prevent the screen from clearing.  This might be
  144.        necessary on some MS-DOS machines.
  145.  
  146.    p - Current Position in BYE.LNS file(s).
  147.  
  148.    r - Continual Fortune                                            
  149.          This switch will cause FORTUNE to continue giving you fortunes with
  150.        about a five second delay between them.  Hitting any key will cause
  151.        FORTUNE to terminate.
  152.  
  153.    s - So Long Message                                              
  154.          If you have some sort of logging out routine, this might be a nice
  155.        touch to add to it.
  156.  
  157.    sl- So Long Message and Lock up System
  158.          If you have some sort of standard logout routine, you might want to
  159.         use this option so that the user WILL have to reboot his system.
  160.  
  161.    t - Instructs FORTUNE to tell you, when printing the fortune, which
  162.         Bye.Lns file the fortune came from.  Useful only if you are using more
  163.         than one Bye.Lns file (Like I do).
  164.  
  165.    u - Don't Use an Index File.  See Below.
  166.  
  167.    # - Changes color of text                                        
  168.          This switch will cause FORTUNE to display your fortune in some other
  169.         color.  Enter the number of the color you want.
  170.  
  171.  
  172.   Your_Name field is simply your name.  This field can be omitted if the
  173. environment variable NAME is set to your name.  FORTUNE will use the command
  174. line value of your name before it uses the environment value.  Additionally,
  175. if you would like to specify your name on the command line and you want to
  176. use multiple words, you must surround your name by quotation marks.  This is
  177. not necessary when using the Environment variable NAME.  The maximum length
  178. your name can be is 50 characters.
  179.  
  180. Creating Default Switches
  181. -------------------------
  182.  
  183.    Once you determine the command line switches you like to use, you can set
  184. the Environment variable FORTUNE to those command line switches.  So, lets
  185. say you don't like fortune to clear your screen and you like the color 3.
  186. Use the command  SET FORTUNE=/n/3   to set these up as defaults.  As with all
  187. other environment, these settings can be overridden on the command line.
  188.  
  189.  
  190. Using an Index File
  191. -------------------
  192.    FORTUNE, by default, creates an index file for your Bye.Lns file.  This
  193. index file is used to create truly random fortunes.  Optionally, using the
  194. -u switch you can prevent this use of an index file.  The trade off is disk
  195. space vs. randomness.  If you use an index file, you are limited to 2500
  196. fortunes per Bye.Lns file.  This equates to a Bye.Lns file size of approx.
  197. 200k.  The current size is 80k.  If you do find that you have a file larger
  198. than this, simply split it into two files and use the environment variable
  199. LINES to specify the two file names (see above).  Each Index file takes up
  200. 7k worth of disk space.
  201.  
  202.  
  203. GETTING HELP
  204.  
  205.   Help can be gotten on the command line by entering  FORTUNE ? <return>.
  206.  
  207.  
  208. SUMMARY OF CHANGES:
  209. (there have been quite a few!)
  210.  
  211. 1.00  Original version of FORTUNE
  212.  
  213. 2.00  Allowed the bye lines file to be any size and added proper parameter
  214.          parsing.
  215.  
  216. 2.10  In house version.
  217.  
  218. 2.20  Fixed the random number generator to give a number much closer to
  219.        a true random number.
  220.  
  221. 3.00  It seems that Turbo Pascal's random number generator uses the clock
  222.        in such a way that any number which you seed it with makes no
  223.        difference on boot.  That is because the clock has only ticked so 
  224.        many cycles I believe.  In any event, I implemented my own random
  225.        number generator along with Borland's to give a good number on boot!
  226.  
  227. 3.01  Fixed minor bug for Early morning risers: message was scewed up ...
  228.         Hell, I never get up THAT early!
  229.  
  230. 3.10  Seems that the number generator was still having problems in certain
  231.         cases.  It has been changed to "walk" through the fortune file.  This
  232.         technique should give much better numbers.
  233.  
  234. 3.20  Added ANSI graphics support and an option to lock up the system after
  235.         saying SO-LONG.
  236.  
  237. 3.21  Added /p option to see position in BYE.LNS file.  Useful to track how
  238.         random fortune is.  NOTE:  Fortune uses a stepping routine to step
  239.         through the BYE.LNS file so be aware of this when looking at the
  240.         number.
  241.  
  242. 3.22  Corrected /r option so that BYE.LNS position is updated at the
  243.         end of the repeat.  Makes for better repeating randomness.
  244.  
  245. 3.30  - Fixed problem with Path definition being longer than 80 characters.
  246.         It is now set to 255 characters (the DOS limit).
  247.       - Added Environment Variable LINES to specify a file other than the
  248.         default BYE.LNS file.  Also added command line switch -F to override
  249.         the same default file.
  250.       - Added Environment Variable FORTUNE to allow setting of default
  251.         values.  Also added command line switch -c to clear the screen (to be
  252.         used to override the no clear screen option set with FORTUNE=).
  253.       - Added On-line help information.
  254.  
  255. 3.40  - Added /D option allow changing of separator character in BYE.LNS file.
  256.         See above documentation before attempting to use this feature!
  257.       - Fortune Now comes with a utility called FORTCONV.COM.  This utility
  258.         will take a files of bye lines, each one separated by a blank line,
  259.         and convert them to Fortune's standard format (each on separated by
  260.         a Null Character (^@).  See its associated documentation for complete
  261.         details.
  262.       - Added multiple file capability.  Set your environment variable
  263.         LINES to all the files you have fortunes in.  Seperate each one with
  264.         a semicolon (;).
  265.  
  266. 4.00  - In-House version.  Never released.
  267. 4.01  - In-House version.  Never released.
  268.  
  269. 4.02  - Added Indexing Capabilities.  This means that all fortunes have an
  270.         equal weight.  Previously, Fortune choose a random place in the file
  271.         and printed that Fortune.  This resulted in some fortunes being
  272.         displayed more than others.  The trade off is disk space.  For each
  273.         Fortune File, using the indexing method, you must give up 7k.  Overall,
  274.         this is a very small price to pay for the quality of the fortune you
  275.         get.  If you would like to use the old method, use the -u switch to
  276.         prevent use of the index file.  The -i switch turns the indexing
  277.         option on (default).
  278.       - Optimized the Code a little more
  279.       - Worked on the Random Number Generator again (last time).
  280.       - Returns ErrorLevel depending on function.  An information function
  281.         (such as help) returns ErrorLevel 2, an error returns ErrorLevel 1 and
  282.         a normal termination is ErrorLevel 0.
  283.       - Modified -p switch to give more information about the Bye.Lns file.
  284.       - added a help message when using the -r switch.
  285. 4.03  - Added the ability to turn of the Greeting message.  This switch is a
  286.         toggling switch.  (e.g. to turn the greeting off, use -h.  Another
  287.         occurance of it turns the greeting back on)
  288.       - Added BBS mode where Fortune will tell print the fortune without
  289.         clearing the screen and in ANSI mode.  It will also print a more
  290.         appropriate message.
  291. 4.04  - FORTUNE now looks at the day of the week to and adjusts some of its
  292.         messages accordingly.
  293. 4.05  - Made fortune print <TABS> as spaces.  Bye.Lns can now contain tabs.
  294. 4.06  - Added -T switch to cause fortune to tell you which BYE.LNS file
  295.         your fortune is coming from (Useful if you use more than one like I do)
  296. 4.07  - Had a problem with switches entered like: /r/n - note that there is no
  297.         space between.  Fortune now will parse this correctly.
  298.       - Fixed problem when specifying /r/n:  The message was slighty messy.
  299.       - Also adjusted greeting message to be "more timely".
  300.       - /p parameter now reports on all accessable BYE.LNS file(s).
  301. 4.08  - Fixed FORTUNE to allow more than one parameter in FORTUNE environment
  302.         variable.  It also allows you to put your name is this variable.
  303.         Therefor, you could combine all the environment variables into this
  304.         single one.
  305. 4.09  - Changed Fortune to allow you to use a multiple word name on the
  306.         command line.  Do this by surrounding the name by quotes.  NOTE: Quotes
  307.         are not allowed in your name.  The maximum length of your name has
  308.         been increased from 20 characters to 50 characters.
  309. 4.10  - Fixed bug when you used quotes in variable FORTUNE.  This has now been
  310.         made illegal.  If your name is multiple wods you must use NAME=.
  311.  
  312. Future Versions:
  313.  
  314.    I hope to add some data compression algorithms to cut down on the size of
  315.  the Bye.Lns files(s).  Mine is now over 300k long.  A good compression would
  316.  cute that size down to 140k at the most.
  317.    And who knows what else ....
  318.  
  319.